; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=instcombine -S < %s | FileCheck %s

define void @PR37526(ptr %pz, ptr %px, ptr %py) {
; CHECK-LABEL: @PR37526(
; CHECK-NEXT:    [[T2:%.*]] = load i32, ptr [[PY:%.*]], align 4
; CHECK-NEXT:    [[T3:%.*]] = load i32, ptr [[PX:%.*]], align 4
; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[T2]], [[T3]]
; CHECK-NEXT:    [[SELECT:%.*]] = select i1 [[CMP]], ptr [[PX]], ptr [[PY]]
; CHECK-NEXT:    [[R:%.*]] = load i64, ptr [[SELECT]], align 4
; CHECK-NEXT:    store i64 [[R]], ptr [[PZ:%.*]], align 4
; CHECK-NEXT:    ret void
;
  %t2 = load i32, ptr %py
  %t3 = load i32, ptr %px
  %cmp = icmp slt i32 %t2, %t3
  %select = select i1 %cmp, ptr %px, ptr %py
  %r = load i64, ptr %select
  store i64 %r, ptr %pz
  ret void
}
